<--- %%NOBANNER%% --> attrc.sas
 BackForward
%macro attrc(ds,attrib);
%local _attrcdsid_ _attrcrc_;
%let _attrcdsid_=%sysfunc(open(&ds,is));
%if &_attrcdsid_ EQ 0 %then %do;
  %put ERROR: (attrc) Dataset %data(&ds) not opened due to the following reason:;
  %put %sysfunc(sysmsg());
%end;
%else %do;
%sysfunc(attrc(&_attrcdsid_,&attrib))
  %let _attrcrc_=%sysfunc(close(&_attrcdsid_));
%end;
%mend;